package com.liming.shop.client;

import com.liming.common.pojo.dto.shop.ShopAddOrUpdateDTO;
import com.liming.common.pojo.dto.shop.ShopPageQuery;
import com.liming.common.pojo.vo.PageVO;
import com.liming.common.pojo.vo.shop.ShopVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

/**
 * 商店|自提点 OpenFeign客户端
 *
 * @author liming
 * @date 2025/1/13
 */
@FeignClient(value = "shop-service", path = "/service/shop")
public interface ShopClient {

    /**
     * 分页
     *
     * @param shopPageQuery 分页参数
     * @return PageVO<ShopVO>
     */
    @GetMapping
    PageVO<ShopVO> page(@SpringQueryMap ShopPageQuery shopPageQuery);

    /**
     * 根据自提点ID获取自提点信息
     *
     * @param pickupPointId 自提点ID
     * @return 自提点名称/自提点联系电话/自提点地址
     */
    @GetMapping("{pickupPointId}")
    String pickupPointInfoById(@PathVariable Long pickupPointId);

    /**
     * 新增
     *
     * @param shopAddOrUpdateDTO 新增参数
     * @return Boolean
     */
    @PostMapping
    Boolean add(@RequestBody ShopAddOrUpdateDTO shopAddOrUpdateDTO);

    /**
     * 更新
     *
     * @param shopAddOrUpdateDTO 更新参数
     * @return Boolean
     */
    @PutMapping
    Boolean update(@RequestBody ShopAddOrUpdateDTO shopAddOrUpdateDTO);

    /**
     * 删除
     *
     * @param id id
     * @return Boolean
     */
    @DeleteMapping("{id}")
    Boolean delete(@PathVariable Long id);
}
